package com.faithbj.support.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 电子比对请求类
 * 
 * @author chen liu
 */
public class CompareRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    private String batchNum; // 批次号
    private String departmentNum; // 部门编号
    private String mainApplicantName; // 主申请人姓名
    private String mainApplicantCardType; // 主申请人证件类型
    private String mainApplicantCardId; // 主申请人身证件号码
    private List<Applicant> applicants = new ArrayList<CompareRequest.Applicant>(); // 申请人列表
    private Date startDate; // 起始日期
    private Date endDate; // 截止日期

    private String applyNum; // 申请编号=受理编号

    public CompareRequest() {
    }

    public CompareRequest(String batchNum, String departmentNum, String mainApplicantName,
            String mainApplicantCardType, String mainApplicantCardId, Date startDate, Date endDate, String applyNum) {
        this.batchNum = batchNum;
        this.departmentNum = departmentNum;
        this.mainApplicantName = mainApplicantName;
        this.mainApplicantCardType = mainApplicantCardType;
        this.mainApplicantCardId = mainApplicantCardId;
        this.startDate = startDate;
        this.endDate = endDate;
        this.applyNum = applyNum;
    }

    public String getBatchNum() {
        return batchNum;
    }

    public void setBatchNum(String batchNum) {
        this.batchNum = batchNum;
    }

    public String getDepartmentNum() {
        return departmentNum;
    }

    public void setDepartmentNum(String departmentNum) {
        this.departmentNum = departmentNum;
    }

    public String getMainApplicantName() {
        return mainApplicantName;
    }

    public void setMainApplicantName(String mainApplicantName) {
        this.mainApplicantName = mainApplicantName;
    }

    public String getMainApplicantCardType() {
        return mainApplicantCardType;
    }

    public void setMainApplicantCardType(String mainApplicantCardType) {
        this.mainApplicantCardType = mainApplicantCardType;
    }

    public String getMainApplicantCardId() {
        return mainApplicantCardId;
    }

    public void setMainApplicantCardId(String mainApplicantCardId) {
        this.mainApplicantCardId = mainApplicantCardId;
    }

    public List<Applicant> getApplicants() {
        return applicants;
    }

    public void addApplicant(String applicantName, String applicantCardType, String applicantCardId) {
        applicants.add(new Applicant(applicantName, applicantCardType, applicantCardId));
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getApplyNum() {
        return applyNum;
    }

    public void setApplyNum(String applyNum) {
        this.applyNum = applyNum;
    }

    public class Applicant {
        private String applicantName; // 申请人姓名
        private String applicantCardType; // 申请人证件类型
        private String applicantCardId; // 申请人证件号码

        public Applicant(String applicantName, String applicantCardType, String applicantCardId) {
            this.applicantName = applicantName;
            this.applicantCardType = applicantCardType;
            this.applicantCardId = applicantCardId;
        }

        public String getApplicantName() {
            return applicantName;
        }

        public void setApplicantName(String applicantName) {
            this.applicantName = applicantName;
        }

        public String getApplicantCardType() {
            return applicantCardType;
        }

        public void setApplicantCardType(String applicantCardType) {
            this.applicantCardType = applicantCardType;
        }

        public String getApplicantCardId() {
            return applicantCardId;
        }

        public void setApplicantCardId(String applicantCardId) {
            this.applicantCardId = applicantCardId;
        }
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("batchNum = " + batchNum).append("departmentNum = " + departmentNum)
                .append("mainApplicantName = " + mainApplicantName)
                .append("mainApplicantCardType = " + mainApplicantCardType)
                .append("mainApplicantCardId = " + mainApplicantCardId).append("startDate = " + startDate)
                .append("endDate = " + endDate).append("applyNum = " + applyNum);
        sb.append("applicants = [");
        for (Applicant applicant : getApplicants()) {
            sb.append(applicant.getApplicantName() + "-" + applicant.getApplicantCardId() + ";");
        }
        sb.append("]");
        return sb.toString();
    }

}
